﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NGUYENTHANHDONG.Excercise.Bai3
{
    public partial class DoikgSangPound : Form
    {
        public DoikgSangPound()
        {
            InitializeComponent();
        }

        private void btnXacNhan_Click(object sender, EventArgs e)
        {
            erpLoi.Clear();

            if(string.IsNullOrEmpty(txtInput.Text))
            {
                erpLoi.SetError(txtInput, "Khong dc de trong !!");
                txtInput.Focus();
            }
            else
            {
                UserEntity objUser = new UserEntity(double.Parse(txtInput.Text));

                CONTROLLERS con = new CONTROLLERS();

                lsbResult.Items.Add("+ " +  txtInput.Text + " kg = " + con.Chuyendoi(objUser) + " pounds");
            }
        }
    }
}
